package com.mediacloud.app.newsmodule.fragment.video.vod;

import android.content.IntentFilter;
import android.widget.TextView;

import com.mediacloud.app.newsmodule.R;
import com.mediacloud.app.newsmodule.broadcast.VideoVodBroadcast;
import com.mediacloud.app.newsmodule.broadcast.VideoVodBroadcast.VodItemClickHandle;
import com.mediacloud.app.model.fragment.BaseFragment;
import com.mediacloud.app.model.news.ArticleItem;
/**
 * 视频介绍页面
 * @author x
 *
 */
public class VideoVodIntroduce extends BaseFragment implements VodItemClickHandle {
	TextView videoIntroduce;
	VideoVodBroadcast broadcast;
	public VideoVodIntroduce()
	{
	}

	@Override
	public int getLayoutResID() {
		return R.layout.aappfactory_videovod_introduce;
	}

	@Override
	public void initView()
	{
		videoIntroduce=findViewById(R.id.videoIntroduce);
		videoIntroduce.setText(getFragmentArguments().getString("summary"));
	}
	@Override
	protected void initOther() {
		super.initOther();
		broadcast=new VideoVodBroadcast();
		broadcast.clickHandle=this;
		IntentFilter filter=new IntentFilter();
		filter.addAction(VideoVodBroadcast.VodAction);
		getActivity().registerReceiver(broadcast, filter);
	}
	@Override
	public void onDestroy() {
		super.onDestroy();
		getActivity().unregisterReceiver(broadcast);
	}

	@Override
	public void itemClick(ArticleItem articleItem) 
	{
		videoIntroduce.setText(articleItem.getSummary());
	}

}